﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-39155502-5"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
  
      gtag('config', 'UA-39155502-5');
    </script>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Transaction
   | MongoDB.Entities </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Transaction
   | MongoDB.Entities ">
    <meta name="generator" content="docfx 2.58.0.0">
    <meta name="description" content="A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management.">
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    <meta property="docfx:rel" content="../">
    <meta property="docfx:newtab" content="true">
    <meta property="og:title" content="MongoDB.Entities">
    <meta property="og:site_name" content="MongoDB.Entities">
    <meta property="og:url" content="https://mongodb-entities.com">
    <meta property="og:description" content="A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management,">
    <meta property="og:type" content="website">
    <meta property="og:image" content="https://mongodb-entities.com/images/social-square.png">  
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../images/icon.png" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list">Search Results for <span></span></div>
          <div class="sr-items">
            <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
          </div>
          <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="MongoDB.Entities.Transaction">
  
  
  <h1 id="MongoDB_Entities_Transaction" data-uid="MongoDB.Entities.Transaction" class="text-break">Class Transaction
  </h1>
  <div class="markdown level0 summary"><p>Represents a transaction used to carry out inter-related write operations.</p>
<p>TIP: Remember to always call .Dispose() after use or enclose in a &apos;Using&apos; statement.</p>
<p>IMPORTANT: Use the methods on this transaction to perform operations and not the methods on the DB class.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><a class="xref" href="MongoDB.Entities.DBContext.html">DBContext</a></div>
    <div class="level2"><span class="xref">Transaction</span></div>
  </div>
  <div classs="implements">
    <h5>Implements</h5>
    <div><span class="xref">System.IDisposable</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CreateCollectionAsync__1_System_Action_MongoDB_Driver_CreateCollectionOptions___0___System_Threading_CancellationToken_">DBContext.CreateCollectionAsync&lt;T&gt;(Action&lt;CreateCollectionOptions&lt;T&gt;&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_DropCollectionAsync__1">DBContext.DropCollectionAsync&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CountEstimatedAsync__1_System_Threading_CancellationToken_">DBContext.CountEstimatedAsync&lt;T&gt;(CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CountAsync__1_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___System_Threading_CancellationToken_MongoDB_Driver_CountOptions_System_Boolean_">DBContext.CountAsync&lt;T&gt;(Expression&lt;Func&lt;T, Boolean&gt;&gt;, CancellationToken, CountOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CountAsync__1_System_Threading_CancellationToken_">DBContext.CountAsync&lt;T&gt;(CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CountAsync__1_MongoDB_Driver_FilterDefinition___0__System_Threading_CancellationToken_MongoDB_Driver_CountOptions_System_Boolean_">DBContext.CountAsync&lt;T&gt;(FilterDefinition&lt;T&gt;, CancellationToken, CountOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CountAsync__1_System_Func_MongoDB_Driver_FilterDefinitionBuilder___0__MongoDB_Driver_FilterDefinition___0___System_Threading_CancellationToken_MongoDB_Driver_CountOptions_System_Boolean_">DBContext.CountAsync&lt;T&gt;(Func&lt;FilterDefinitionBuilder&lt;T&gt;, FilterDefinition&lt;T&gt;&gt;, CancellationToken, CountOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_ModifiedBy">DBContext.ModifiedBy</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Session">DBContext.Session</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Transaction_System_String_MongoDB_Driver_ClientSessionOptions_">DBContext.Transaction(String, ClientSessionOptions)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Transaction__1_MongoDB_Driver_ClientSessionOptions_">DBContext.Transaction&lt;T&gt;(ClientSessionOptions)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_CommitAsync_System_Threading_CancellationToken_">DBContext.CommitAsync(CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_AbortAsync_System_Threading_CancellationToken_">DBContext.AbortAsync(CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_OnBeforeSave__1">DBContext.OnBeforeSave&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_OnBeforeUpdate__1">DBContext.OnBeforeUpdate&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilter__1_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___System_Boolean_">DBContext.SetGlobalFilter&lt;T&gt;(Expression&lt;Func&lt;T, Boolean&gt;&gt;, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilter__1_System_Func_MongoDB_Driver_FilterDefinitionBuilder___0__MongoDB_Driver_FilterDefinition___0___System_Boolean_">DBContext.SetGlobalFilter&lt;T&gt;(Func&lt;FilterDefinitionBuilder&lt;T&gt;, FilterDefinition&lt;T&gt;&gt;, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilter__1_MongoDB_Driver_FilterDefinition___0__System_Boolean_">DBContext.SetGlobalFilter&lt;T&gt;(FilterDefinition&lt;T&gt;, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilter_System_Type_System_String_System_Boolean_">DBContext.SetGlobalFilter(Type, String, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilterForBaseClass__1_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___System_Boolean_">DBContext.SetGlobalFilterForBaseClass&lt;TBase&gt;(Expression&lt;Func&lt;TBase, Boolean&gt;&gt;, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilterForBaseClass__1_System_Func_MongoDB_Driver_FilterDefinitionBuilder___0__MongoDB_Driver_FilterDefinition___0___System_Boolean_">DBContext.SetGlobalFilterForBaseClass&lt;TBase&gt;(Func&lt;FilterDefinitionBuilder&lt;TBase&gt;, FilterDefinition&lt;TBase&gt;&gt;, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilterForBaseClass__1_MongoDB_Driver_FilterDefinition___0__System_Boolean_">DBContext.SetGlobalFilterForBaseClass&lt;TBase&gt;(FilterDefinition&lt;TBase&gt;, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SetGlobalFilterForInterface__1_System_String_System_Boolean_">DBContext.SetGlobalFilterForInterface&lt;TInterface&gt;(String, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_DeleteAsync__1_System_String_System_Threading_CancellationToken_System_Boolean_">DBContext.DeleteAsync&lt;T&gt;(String, CancellationToken, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_DeleteAsync__1_System_Collections_Generic_IEnumerable_System_String__System_Threading_CancellationToken_System_Boolean_">DBContext.DeleteAsync&lt;T&gt;(IEnumerable&lt;String&gt;, CancellationToken, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_DeleteAsync__1_System_Linq_Expressions_Expression_System_Func___0_System_Boolean___System_Threading_CancellationToken_MongoDB_Driver_Collation_System_Boolean_">DBContext.DeleteAsync&lt;T&gt;(Expression&lt;Func&lt;T, Boolean&gt;&gt;, CancellationToken, Collation, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_DeleteAsync__1_System_Func_MongoDB_Driver_FilterDefinitionBuilder___0__MongoDB_Driver_FilterDefinition___0___System_Threading_CancellationToken_MongoDB_Driver_Collation_System_Boolean_">DBContext.DeleteAsync&lt;T&gt;(Func&lt;FilterDefinitionBuilder&lt;T&gt;, FilterDefinition&lt;T&gt;&gt;, CancellationToken, Collation, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_DeleteAsync__1_MongoDB_Driver_FilterDefinition___0__System_Threading_CancellationToken_MongoDB_Driver_Collation_System_Boolean_">DBContext.DeleteAsync&lt;T&gt;(FilterDefinition&lt;T&gt;, CancellationToken, Collation, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Distinct__2">DBContext.Distinct&lt;T, TProperty&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Find__1">DBContext.Find&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Find__2">DBContext.Find&lt;T, TProjection&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Fluent__1_MongoDB_Driver_AggregateOptions_System_Boolean_">DBContext.Fluent&lt;T&gt;(AggregateOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_FluentTextSearch__1_MongoDB_Entities_Search_System_String_System_Boolean_System_Boolean_System_String_MongoDB_Driver_AggregateOptions_System_Boolean_">DBContext.FluentTextSearch&lt;T&gt;(Search, String, Boolean, Boolean, String, AggregateOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_GeoNear__1_MongoDB_Entities_Coordinates2D_System_Linq_Expressions_Expression_System_Func___0_System_Object___System_Boolean_System_Nullable_System_Int32__System_Nullable_System_Int32__System_Nullable_System_Int32__MongoDB_Bson_BsonDocument_System_Nullable_System_Int32__System_Linq_Expressions_Expression_System_Func___0_System_Object___System_String_MongoDB_Driver_AggregateOptions_System_Boolean_">DBContext.GeoNear&lt;T&gt;(Coordinates2D, Expression&lt;Func&lt;T, Object&gt;&gt;, Boolean, Nullable&lt;Int32&gt;, Nullable&lt;Int32&gt;, Nullable&lt;Int32&gt;, BsonDocument, Nullable&lt;Int32&gt;, Expression&lt;Func&lt;T, Object&gt;&gt;, String, AggregateOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_InsertAsync__1___0_System_Threading_CancellationToken_">DBContext.InsertAsync&lt;T&gt;(T, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_InsertAsync__1_System_Collections_Generic_IEnumerable___0__System_Threading_CancellationToken_">DBContext.InsertAsync&lt;T&gt;(IEnumerable&lt;T&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_PagedSearch__1">DBContext.PagedSearch&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_PagedSearch__2">DBContext.PagedSearch&lt;T, TProjection&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_PipelineCursorAsync__2_MongoDB_Entities_Template___0___1__MongoDB_Driver_AggregateOptions_System_Threading_CancellationToken_System_Boolean_">DBContext.PipelineCursorAsync&lt;T, TResult&gt;(Template&lt;T, TResult&gt;, AggregateOptions, CancellationToken, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_PipelineAsync__2_MongoDB_Entities_Template___0___1__MongoDB_Driver_AggregateOptions_System_Threading_CancellationToken_System_Boolean_">DBContext.PipelineAsync&lt;T, TResult&gt;(Template&lt;T, TResult&gt;, AggregateOptions, CancellationToken, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_PipelineSingleAsync__2_MongoDB_Entities_Template___0___1__MongoDB_Driver_AggregateOptions_System_Threading_CancellationToken_System_Boolean_">DBContext.PipelineSingleAsync&lt;T, TResult&gt;(Template&lt;T, TResult&gt;, AggregateOptions, CancellationToken, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_PipelineFirstAsync__2_MongoDB_Entities_Template___0___1__MongoDB_Driver_AggregateOptions_System_Threading_CancellationToken_System_Boolean_">DBContext.PipelineFirstAsync&lt;T, TResult&gt;(Template&lt;T, TResult&gt;, AggregateOptions, CancellationToken, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Queryable__1_MongoDB_Driver_AggregateOptions_System_Boolean_">DBContext.Queryable&lt;T&gt;(AggregateOptions, Boolean)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Replace__1">DBContext.Replace&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SaveAsync__1___0_System_Threading_CancellationToken_">DBContext.SaveAsync&lt;T&gt;(T, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SaveAsync__1_System_Collections_Generic_IEnumerable___0__System_Threading_CancellationToken_">DBContext.SaveAsync&lt;T&gt;(IEnumerable&lt;T&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SaveOnlyAsync__1___0_System_Linq_Expressions_Expression_System_Func___0_System_Object___System_Threading_CancellationToken_">DBContext.SaveOnlyAsync&lt;T&gt;(T, Expression&lt;Func&lt;T, Object&gt;&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SaveOnlyAsync__1_System_Collections_Generic_IEnumerable___0__System_Linq_Expressions_Expression_System_Func___0_System_Object___System_Threading_CancellationToken_">DBContext.SaveOnlyAsync&lt;T&gt;(IEnumerable&lt;T&gt;, Expression&lt;Func&lt;T, Object&gt;&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SaveExceptAsync__1___0_System_Linq_Expressions_Expression_System_Func___0_System_Object___System_Threading_CancellationToken_">DBContext.SaveExceptAsync&lt;T&gt;(T, Expression&lt;Func&lt;T, Object&gt;&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SaveExceptAsync__1_System_Collections_Generic_IEnumerable___0__System_Linq_Expressions_Expression_System_Func___0_System_Object___System_Threading_CancellationToken_">DBContext.SaveExceptAsync&lt;T&gt;(IEnumerable&lt;T&gt;, Expression&lt;Func&lt;T, Object&gt;&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_SavePreservingAsync__1___0_System_Threading_CancellationToken_">DBContext.SavePreservingAsync&lt;T&gt;(T, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_Update__1">DBContext.Update&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_UpdateAndGet__1">DBContext.UpdateAndGet&lt;T&gt;()</a>
    </div>
    <div>
      <a class="xref" href="MongoDB.Entities.DBContext.html#MongoDB_Entities_DBContext_UpdateAndGet__2">DBContext.UpdateAndGet&lt;T, TProjection&gt;()</a>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="MongoDB.Entities.html">MongoDB.Entities</a></h6>
  <h6><strong>Assembly</strong>: MongoDB.Entities.dll</h6>
  <h5 id="MongoDB_Entities_Transaction_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Transaction : DBContext, IDisposable</code></pre>
  </div>
  <h3 id="constructors">Constructors
  </h3>
  
  
  <a id="MongoDB_Entities_Transaction__ctor_" data-uid="MongoDB.Entities.Transaction.#ctor*"></a>
  <h4 id="MongoDB_Entities_Transaction__ctor_System_String_MongoDB_Driver_ClientSessionOptions_MongoDB_Entities_ModifiedBy_" data-uid="MongoDB.Entities.Transaction.#ctor(System.String,MongoDB.Driver.ClientSessionOptions,MongoDB.Entities.ModifiedBy)">Transaction(String, ClientSessionOptions, ModifiedBy)</h4>
  <div class="markdown level1 summary"><p>Instantiates and begins a transaction.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Transaction(string database = null, ClientSessionOptions options = null, ModifiedBy modifiedBy = null)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">database</span></td>
        <td><p>The name of the database to use for this transaction. default db is used if not specified</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">MongoDB.Driver.ClientSessionOptions</span></td>
        <td><span class="parametername">options</span></td>
        <td><p>Client session options for this transaction</p>
</td>
      </tr>
      <tr>
        <td><a class="xref" href="MongoDB.Entities.ModifiedBy.html">ModifiedBy</a></td>
        <td><span class="parametername">modifiedBy</span></td>
        <td><p>An optional ModifiedBy instance.
When supplied, all save/update operations performed via this DBContext instance will set the value on entities that has a property of type ModifiedBy.
You can inherit from the ModifiedBy class and add your own properties to it.
Only one ModifiedBy property is allowed on a single entity type.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
  </h3>
  
  
  <a id="MongoDB_Entities_Transaction_Dispose_" data-uid="MongoDB.Entities.Transaction.Dispose*"></a>
  <h4 id="MongoDB_Entities_Transaction_Dispose" data-uid="MongoDB.Entities.Transaction.Dispose">Dispose()</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
  </div>
  
  
  <a id="MongoDB_Entities_Transaction_Dispose_" data-uid="MongoDB.Entities.Transaction.Dispose*"></a>
  <h4 id="MongoDB_Entities_Transaction_Dispose_System_Boolean_" data-uid="MongoDB.Entities.Transaction.Dispose(System.Boolean)">Dispose(Boolean)</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">protected virtual void Dispose(bool disposing)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><span class="parametername">disposing</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h3 id="implements">Implements</h3>
  <div>
      <span class="xref">System.IDisposable</span>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>In This Article</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            Developed by <a href='https://github.com/dj-nitehawk'>Đĵ ΝιΓΞΗΛψΚ</a> and <a href='https://github.com/dj-nitehawk/MongoDB.Entities/graphs/contributors'>contributors</a> / Licensed under <a href='https://github.com/dj-nitehawk/MongoDB.Entities/blob/master/LICENSE'>MIT</a> / Website generated by <a href='https://dotnet.github.io/docfx/'>DocFX</a>
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
